<!-- Dom模板 -->
<template>
  <div id="box">
    <div class="content">
      <h2>购买</h2>
      <p>本书为VIP免费，VIP会员可免费看全集</p>
      <span>￥<a>500</a>Maco蛋</span>
      <div class="button">
        <button @click='close'>购买</button>
        <button @click='close' class="cancel">取消</button>
      </div>
    </div>
  </div>
</template>

<script>
// import a from './a'; // 引入组件
export default {
  data() {
    return {
      msg: "测试",
      alertFlag: false,
      nowIndex: 0,
      item: {},
      hua: true,
    };
  }, // 生命周期 - 创建完成（访问当前this实例）
  created() {}, // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {}, // Vue方法定义
  methods: {
    click(item, index) {
      this.nowIndex = index;
      this.item = item;
    },
    close(){
      this.$emit('close',{alertFlag:false})
    }
  },
};
</script>

<style scoped>
/* @import url(); 引入css类 */
#box {
  position: fixed;
  width:100vw;
  border-radius: 30px 30px 0 0;
}
.content {
  text-align: center;
}
.content h2 {
  width: 50px;
  margin: 10px auto;
}
.content p{
    color: rgb(167, 164, 164);
    margin-bottom:20px;
}
.content span{
    font-size: 40px;
    color: #f86742;
}
.content a{
    font-size: 65px;
    color: #f86742;
}
.content .button{
    padding:0 15px;
    display: flex;
    justify-content: space-between;
    margin-top:20px;
}
button {
  width: 40%;
  padding: 5px 0;
  display: block;
  margin: 15px auto;
  border-radius: 25px;
  border: none;
  color: white;
  background: #f86742;
  font-size: 18px;
}
.cancel{
    color: black;
    background: #ccc;
}
</style>